package turistic.GUI.graphic;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;

import android.util.Log;

public class Connection {
	String sentence = null;
	String modifiedSentence;
	String tempus;
	private ObjectInputStream sInput;
	private ObjectOutputStream sOutput;
	String mess;
	
	
	Connection(String info) {
		try {

			Socket clientSocket = new Socket("192.168.0.101", 9055);
			try {
				sInput = new ObjectInputStream(clientSocket.getInputStream());
				sOutput = new ObjectOutputStream(clientSocket.getOutputStream());
				sOutput.writeObject(info);
				mess = (String) sInput.readObject();
			} catch (IOException eIO) {
				Log.d("error","Exception creating new Input/output Streams: "+ eIO);
			}
			Log.d("pre", "TCP Connected.");

			//modifiedSentence = inFromServer.readLine();
			 

			clientSocket.close();

		} catch (Exception e) {
			Log.d("error", "TCP Error: " + e.toString());
		}
	}
	public String getMess() {
		return mess;
	}
}